<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color:#407bb3;
}
</style>
<script type="text/javascript">
function validateform(){

var i=0;
    var title1=document.getElementById("textfield").value;
	var title2=document.getElementById("textfield4").value;
	var title3=document.getElementById("textfield7").value;
	var imglink1=document.getElementById("textfield2").value;
		var imgtxt1=document.getElementById("textfield3").value;
		var imglink2=document.getElementById("textfield5").value;
		var imgtxt2=document.getElementById("textfield6").value;
		var imglink3=document.getElementById("textfield8").value;
		var imgtxt3=document.getElementById("textfield9").value;
		if(title1=="" && title2=="" && title3==""){
	alert("Please enter complete details of atleast one tab.Tab tilte is mandatory");
		i=1;
	document.getElementById("textfield").focus();
	}
	else{
		if(title1!=""){
			if(imglink1=="" || imgtxt1==""){

				alert("image file name (or) image hyperlink text field is not entered.Please enter the details of a complete tab");
				i=1;
				if(imgllink1=="")
				document.getElementById("textfield2").focus();
				else
				document.getElementById("textfield3").focus();
			}
		}
		if(title2!=""){
		
			if(imglink2=="" || imgtxt2==""){
			alert("inside 2");
				alert("image file name (or) image hyperlink text field is not entered.Please enter the details of a complete tab");
				i=1;
				if(imgllink2=="")
				document.getElementById("textfield5").focus();
				else
				document.getElementById("textfield6").focus();
			}
		}
		if(title3!=""){
		
			if(imglink3=="" || imgtxt3==""){
				alert("image file name (or) image hyperlink text field is not entered.Please enter the details of a complete tab");
				i=1;
				if(imglink3=="")
				document.getElementById("textfield8").focus();
				else
				document.getElementById("textfield9").focus();
			}
		}
	}	

	if(i==0){
  var str="textfield="+title1+"&textfield2="+imglink1+"&textfield3="+imgtxt1+"&textfield4="+title2+"&textfield5="+imglink2+"&textfield6="+imgtxt2+"&textfield7="+title3+"&textfield8="+imglink3+"&textfield9="+imgtxt3;
	window.location="config_ec.jsp?"+str;
	}
}
window.onload=function(){
var xmlDoc;
if (window.ActiveXObject)
			{
			xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
			xmlDoc.async = "false";
			xmlDoc.load("config_ec.xml");
			}
			else if(window.XMLHttpRequest)
			{
				var d = new XMLHttpRequest();
				d.open("GET", "config_ec.xml", false);
				d.send(null);
				xmlDoc=d.responseXML;
			} else {
				xmlDoc = document.implementation.createDocument("", "", null);
				xmlDoc.load("config_ec.xml");
		}

	var tabdata =xmlDoc.getElementsByTagName("tab");
	var len=tabdata.length;
	document.getElementById("textfield").value=tabdata[0].getElementsByTagName("title")[0].childNodes[0].nodeValue;
	document.getElementById("textfield2").value=tabdata[0].getElementsByTagName("imglink")[0].childNodes[0].nodeValue;
	document.getElementById("textfield3").value=tabdata[0].getElementsByTagName("imgtext")[0].childNodes[0].nodeValue;
	if(len>1){
	document.getElementById("textfield4").value=tabdata[1].getElementsByTagName("title")[0].childNodes[0].nodeValue;
	document.getElementById("textfield5").value=tabdata[1].getElementsByTagName("imglink")[0].childNodes[0].nodeValue;
	document.getElementById("textfield6").value=tabdata[1].getElementsByTagName("imgtext")[0].childNodes[0].nodeValue;
	}
	if(len>2){
	document.getElementById("textfield7").value=tabdata[2].getElementsByTagName("title")[0].childNodes[0].nodeValue;
	document.getElementById("textfield8").value=tabdata[2].getElementsByTagName("imglink")[0].childNodes[0].nodeValue;
	document.getElementById("textfield9").value=tabdata[2].getElementsByTagName("imgtext")[0].childNodes[0].nodeValue;
	}
	}
	
</script>
</head>

<body><form action="config_ec.jsp" method="get"> 
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0" style="background:url(images/background01.jpg); border: #6a98c4 solid 1px;">
  <tr>
    <td align="left"><img src="images/logo.jpg" width="397" height="73" /></td>
  </tr>
  <tr>
    <td style="padding-left:15px; padding-right:15px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td style="background-color:#6a98c4; padding:8px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td style="background-color:#2d414c; font-family:Verdana, Geneva, sans-serif; font-size:14px; color:#FFFFFF; padding:10px; font-weight:bold; ">Tabs Configuration Form</td>
          </tr>
          <tr>
            <td height="10px"></td>
          </tr>
          <tr>
            <td><table width="150" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#FFFFFF" style="background-image:url(images/tab_bg.gif); border-right:#FFFFFF solid 1px; font-family:Arial; font-size:12px; color:#000000; padding:8px 5px 7px 10px; font-weight:bold;">Tab 1 Details</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF" style="padding:20px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="6%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Title</td>
                <td width="23%"><input type="text" name="textfield" id="textfield" /></td>
                <td width="11%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Image file name</td>
                <td width="26%"><input type="text" name="textfield2" id="textfield2" /></td>
                <td width="14%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Image hyperlink text</td>
                <td width="20%"><input type="text" name="textfield3" id="textfield3" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="10px"></td>
          </tr>
          <tr>
            <td><table width="150" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#FFFFFF" style="background-image:url(images/tab_bg.gif); border-right:#FFFFFF solid 1px; font-family:Arial; font-size:12px; color:#000000; padding:8px 5px 7px 10px; font-weight:bold;">Tab 2 Details</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF" style="padding:20px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="6%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Title</td>
                <td width="23%"><input type="text" name="textfield" id="textfield4" /></td>
                <td width="11%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Image file name</td>
                <td width="26%"><input type="text" name="textfield" id="textfield5" /></td>
                <td width="14%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Image hyperlink text</td>
                <td width="20%"><input type="text" name="textfield" id="textfield6" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="10px"></td>
          </tr>
          <tr>
            <td><table width="150" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#FFFFFF" style="background-image:url(images/tab_bg.gif); border-right:#FFFFFF solid 1px; font-family:Arial; font-size:12px; color:#000000; padding:8px 5px 7px 10px; font-weight:bold;">Tab 3 Details</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF" style="padding:20px;"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="6%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Title</td>
                <td width="23%"><input type="text" name="textfield" id="textfield7" /></td>
                <td width="11%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Image file name</td>
                <td width="26%"><input type="text" name="textfield" id="textfield8" /></td>
                <td width="14%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px; color:#333333; padding:5px;">Image hyperlink text</td>
                <td width="20%"><input type="text" name="textfield" id="textfield9" /></td>
              </tr>
            </table>
			</td>
          </tr>
		  <tr><td style="padding-top:20px;"><!--<input type="submit" value="submit" onclick="validateform()"/>--><input type="button" value="submit" name="submit" onclick="validateform()" /></td></tr>
        </table></td>
      </tr>
    </table>
	</td>
  </tr>
  <tr>
    <td align="left" valign="top" style="padding-top: 10px; padding-right: 30px; padding-bottom: 10px; padding-left: 20px;">

      <p style="font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; line-height: 1.5;">&copy; 2010 Cisco Systems, Inc. All rights reserved. <a href="http://www.cisco.com/en/US/swassets/sw293/privacy_statement.html" style="color: #FFF">Privacy Statement</a> and <a href="http://www.cisco.com/en/US/swassets/sw293/trademark_statement.html" style="color: #FFF">Trademarks</a> of Cisco Systems, Inc. <a href="http://www.cisco.com/" style="color: #FFF">Cisco.com</a></p></td>
  </tr>
</table>
</form> 
</body>
</html>
